import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    redirect: 'qgzx',
    children: [
      {
        path: 'qgzx',
        name: 'qgzx',
        component: () => import('@/views/Qgzx.vue'),
        meta: {
          title: '情感咨询'
        }
      },
      {
        path: 'qgwt',
        name: 'qgwt',
        component: () => import('@/views/Qgwt.vue'),
        meta: {
          title: '情感问题'
        }
      },
      {
        path: 'whal',
        name: 'whal',
        component: () => import('@/views/Whal.vue'),
        meta: {
          title: '挽回案例'
        }
      },
      {
        path: 'dstd',
        name: 'dstd',
        component: () => import('@/views/Dstd.vue'),
        meta: {
          title: '导师团队'
        }
      },
      {
        path: 'lxwm',
        name: 'lxwm',
        component: () => import('@/views/Lxwm.vue'),
        meta: {
          title: '联系我们'
        }
      },
      {
        path: 'fwgm',
        name: 'fwgm',
        component: () => import('@/views/fwgm/Fwgm.vue'),
        meta: {
          title: '服务购买'
        }
      },
      {
        path: 'appxz',
        name: 'appxz',
        component: () => import('@/views/Appxz.vue'),
        meta: {
          title: 'APP下载'
        }
      }
    ]
  },
  {
    path: '/fwgm-qgwh',
    component: Home,
    hidden: true,
    redirect: 'index',
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/fwgm/FwgmQgwh.vue'),
        meta: {
          title: '服务购买-情感挽回'
        }
      },
      {
        path: 'zfbfk',
        name: 'zfbfk',
        component: () => import('@/views/fwgm/ZfbFk.vue'),
        meta: {
          title: '支付宝付款',
          keepAlive: true
        }
      }
    ]
  },
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
